﻿package com.wandian.util
{
	import com.wandian.data.GameData;

	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.utils.Dictionary;
	/**   
	* @author long
	* @QQ 108232706
	* @version 1.0   
	*/   
	public class CLZTxtTip extends Object
	{
		private static var DICT:Dictionary=new Dictionary();

		public function CLZTxtTip()
		{
			return;
		} 

		public static function addTip(param1:TextField, param2:String):void
		{
			var txtName:String;
			var txt:*=param1;
			var str:*=param2;
			var addTip:*=function():void
			{
				var _loc_1:*=GameData.getSprite("TextTip");
				_loc_1["txt"].autoSize=TextFieldAutoSize.LEFT;
				_loc_1["txt"].htmlText=str;
				_loc_1["txt"].wordWrap=false;
				txt.parent.addChild(_loc_1);
				_loc_1.x=txt.x + txt.width + 20;
				_loc_1.y=txt.y + (txt.height - _loc_1.height) * 0.5 + 3;
				_loc_1["bg"].width=_loc_1["txt"].width + 30;
				DICT[txtName]=_loc_1;
				return;
			} 
			;
			txtName=txt.name;
			if (DICT[txtName])
			{
				removeTip(txt);
			}
//			CLZTxtTip.addTip();
			return;
		} 

		public static function removeTip(param1:TextField):void
		{
			if (DICT[param1.name])
			{
			}
			if (param1.parent.contains(DICT[param1.name]))
			{
				param1.parent.removeChild(DICT[param1.name]);
				delete DICT[param1.name];
				DICT[param1.name]=null;
			}
			return;
		} 

	}
}
